package com.share.design.prototype;

import java.util.Scanner;

/**
 * author:caifan
 * date:2020/2/4
 */
public class Circle implements Shape {
    @Override
    public Object clone() {
        Circle circle = null;
        try {
            circle = (Circle) super.clone();

        } catch (CloneNotSupportedException e) {
            System.out.println(" circle copy failed");
        }
        return circle;
    }

    @Override
    public void countArea() {
        int r=0;
        System.out.print("这是一个圆，请输入圆的半径：");
        Scanner input=new Scanner(System.in);
        r=input.nextInt();
        System.out.println("该圆的面积=" + Math.PI * r * r + "\n");
    }
}
